package com.ragdollcat.thirdaicodegenerate;

import com.ragdollcat.thirdaicodegenerate.core.HtmlCodeResult;
import com.ragdollcat.thirdaicodegenerate.core.MultiFileCodeResult;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.TokenStream;
import dev.langchain4j.service.UserMessage;
import reactor.core.publisher.Flux;

public interface AiCodeGeneratorService {


    /**
     * 生成html代码
     * @return
     */
    @SystemMessage(fromResource = "prompt/html.txt")
    HtmlCodeResult generateHtmlCode(String userText);


    /**
     * 生成多文件代码
     * @return
     */
    @SystemMessage(fromResource = "prompt/mutli-file.txt")
    MultiFileCodeResult generateMultiFileCode(String userText);



    /**
     * 生成html代码
     * @return
     */
    @SystemMessage(fromResource = "prompt/html.txt")
    Flux<String> generateHtmlCodeWithFlux(@UserMessage String userText);


    /**
     * 生成多文件代码
     * @return
     */
    @SystemMessage(fromResource = "prompt/mutli-file.txt")
    Flux<String> generateMultiFileCodeWithFlux(@UserMessage String userText);



    /**
     * 生成vue工程项目代码
     * 带有上下文记忆，这里的appId需要拼接上版本号
     * todo 从这里开始修改，返回值类型改成tokenStream
     * @return
     */
    @SystemMessage(fromResource = "prompt/vue-file.txt")
    TokenStream generateVueProjectCodeWithFlux(@MemoryId String appId, @UserMessage String userText);



}
